package com.bjsxt.search.controller;

import com.bjsxt.search.pojo.Item4ES;
import com.bjsxt.search.service.SearchService;
import com.bjsxt.search.service.impl.SearchServiceImpl;
import com.livegoods.commons.vo.LivegoodsResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : SearchController
 * @Description : 搜索控制器
 * @Author : ZWZ
 * @Date: 2021/8/24 16:41
 */
@RestController
public class SearchController {

    @Autowired
    private SearchService searchService;

    @GetMapping("/search")
    public LivegoodsResult search(String city, String content, int page,
                                  @RequestParam(defaultValue = "4") int size) {
        return searchService.search(city, content, page, size);
    }

}
